<?php
namespace app\index\model;
use think\Model;

class BaseModel extends Model
{
    public  function param_error()
    {
        $_arr['flag'] = -1;
        $_arr['msg'] = '参数错误';
        $_arr['data'] = '';
        return json($_arr);
    }

    protected function returnError($errorMsg='')
    {
        $_arr['flag'] = -1;
        $_arr['msg'] = $errorMsg;
        $_arr['data'] = '';
        return json($_arr);
    }

    protected function returnAlert($alertMsg='')
    {
        $_arr['flag'] = 1;
        $_arr['msg'] = $alertMsg;
        $_arr['data'] = '';
        return json($_arr);
    }

    protected function returnOk($data='')
    {
        $_arr['flag'] = 0;
        $_arr['msg'] = '';
        $_arr['data'] = $data;
        return json($_arr);
    }
}